package stephen.competition11;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;




public class UserBase {
	public boolean update(User u){
		DataBase bd=new DataBase();
		Connection con=bd.getCon();
		String sql="update user set pwd=? where id=1";
		
		try {
			PreparedStatement ps=con.prepareStatement(sql);
			ps.setString(1, u.getPwd());
			ps.execute();
			
			if(ps!=null){
				ps.close();
			}
			if(con!=null){
				con.close();
				
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		return true;
	}
}
